#include <iostream>
using namespace std;

class Person
{
public:
    Person()
    {
        cout << "Person()" << endl;
    }
private:
    int m_age;
};

int main()
{

    /* const_cast用于将const类型转换为非const */
    const char* str = "hello world";
#if 0
    char * buffer = (char*)str;
#else

    char* buffer = const_cast<char*>(str);
    *buffer = 'H';
    cout << str << "," << buffer << endl;

#endif
    /* 复合数据类型 */
    const Person* p1 = new Person();

    Person* p2 = const_cast<Person*>(p1);
}